package com.cqut.forum.action;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cqut.forum.entity.User;

/**
 * 用户退出controller
 * @author yangxun
 */
@Controller
public class ExitAction {
	private User user;
	
	@RequestMapping("/main/exit")
	@ResponseBody
	public String exitAction(HttpServletRequest request,User user){
		//request.getSession().removeAttribute("user");
		request.getSession().setAttribute("user", null);
		return "success";		
	}
	
	
	/***************get and set method*********************/
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
}
